package com.demo.stock.service;

import com.demo.stock.enums.ReduceStockTypeEnum;
import com.demo.stock.vo.BatchReduceStockVo;

import java.util.Map;

/**
 * 批量扣除库存Service类
 *
 * @author admin
 */
public interface ReduceStockService {
    /**
     * 批量更新商品库存
     *
     * @param map                 需要更新的库存列表，key为商品编码，value为扣减的数量
     * @param reduceStockTypeEnum 扣除库存的方式
     * @param beanName            mysql扣库的bean类，可以为空，为空时只扣库redis的库存
     * @param redisKeyPrefix      redisKey前缀
     *
     * @return BatchDeductionCoupon
     */
    BatchReduceStockVo batchReduceStock(Map<String, Integer> map, ReduceStockTypeEnum reduceStockTypeEnum,
                                        String beanName, String redisKeyPrefix);
}
